package reese.think_in_java.java_17_contains;

import java.util.ArrayList;
import java.util.Random;

/**
 * ***********************************************************
 *
 * @类名 : reese.think_in_java.java_17_contains.类名
 * @DESCRIPTION : 这家伙太懒啥都没写
 * @AUTHOR :  一个风情万种的男子
 * @DATE : 2016/6/16
 * ***********************************************************
 */
public class RandomList<T> {
    private ArrayList<T> storage = new ArrayList<T>();
    private Random rand = new Random(47);
    public void add(T item) { storage.add(item); }
    public T select() {
        return storage.get(rand.nextInt(storage.size()));
    }
    public static void main(String[] args) {
        RandomList<String> rs = new RandomList<String>();
        for (String s: ("The quick brown fox jumped over " +
                "the lazy brown dog").split(" ")){
            rs.add(s);
        }
        for(int i = 0; i < 11; i++)
            System.out.print(rs.select() + " ");
    }
}
